home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / tex / tex29 / sttexsrc.zoo / src / box.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-03-13  |  4.0 KB  |  160 lines

  1.  
  2. /*
  3.  * @(#)box.h 2.6 EPA
  4.  *
  5.  * Copyright 1987,1988 Pat J Monardo
  6.  *
  7.  * Redistribution of this file is permitted through
  8.  * the specifications in the file COPYING.
  9.  *
  10.  * 
  11.  */
  12.  
  13. #define type(M)             mem[M].hh.hh2.b0
  14. #define subtype(M)          mem[M].hh.hh2.b1
  15.  
  16. #define font                type
  17. #define character           subtype
  18. #define is_char_node(M)     (M >= hi_mem_min)
  19.  
  20. ptr     new_null_box();
  21.  
  22. #define HLIST_NODE          0
  23. #define VLIST_NODE          1
  24.  
  25. #define BOX_NODE_SIZE       7
  26. #define WIDTH_OFFSET        1
  27. #define DEPTH_OFFSET        2
  28. #define HEIGHT_OFFSET       3
  29. #define SHIFT_OFFSET        4
  30. #define LIST_OFFSET         5
  31. #define GLUE_OFFSET         6
  32. #define width(B)            mem[B + WIDTH_OFFSET].sc
  33. #define depth(B)            mem[B + DEPTH_OFFSET].sc
  34. #define height(B)           mem[B + HEIGHT_OFFSET].sc
  35. #define shift_amount(B)     mem[B + SHIFT_OFFSET].sc
  36. #define list_ptr(B)         link(B + LIST_OFFSET)
  37. #define glue_order(B)       subtype(B + LIST_OFFSET)
  38. #define glue_sign(B)        type(B + LIST_OFFSET)
  39. #define glue_set(B)         mem[B + GLUE_OFFSET].gr
  40.  
  41. #define NORMAL              0
  42. #define STRETCHING          1
  43. #define SHRINKING           2
  44.     
  45. ptr     new_rule();
  46.  
  47. #define RULE_NODE           2
  48. #define RULE_NODE_SIZE      4
  49. #define NULL_FLAG           -010000000000
  50. #define is_running(R)       (R == NULL_FLAG)
  51.  
  52. #define INS_NODE            3
  53. #define INS_NODE_SIZE       5
  54. #define float_cost(I)       mem[I + 1].i
  55. #define ins_ptr(I)          info(I + 4)
  56. #define split_top_ptr(I)    link(I + 4)
  57.     
  58. #define MARK_NODE           4
  59. #define SMALL_NODE_SIZE     2
  60. #define mark_ptr(M)         link(M + 1)
  61.     
  62. #define ADJUST_NODE         5
  63. #define adjust_ptr          mark_ptr
  64.  
  65. ptr     new_ligature();
  66.  
  67. #define LIGATURE_NODE       6
  68. #define lig_char(L)         L + 1
  69. #define lig_ptr(L)          link(lig_char(L))
  70.  
  71. ptr     new_disc();
  72.  
  73. #define DISC_NODE           7
  74. #define replace_count       subtype
  75. #define pre_break           llink
  76. #define post_break          rlink
  77.  
  78. #define WHATSIT_NODE        8
  79.  
  80. ptr     new_math();
  81.  
  82. #define MATH_NODE           9
  83. #define BEFORE              0
  84. #define AFTER               1
  85.  
  86. #define precedes_break(M)   (type(M) < MATH_NODE)
  87. #define non_discardable(M)  (type(M) < MATH_NODE)
  88.  
  89. ptr     new_spec();
  90. ptr     new_param_glue();
  91. ptr     new_glue();
  92. ptr     new_skip_param();
  93.  
  94. #define GLUE_NODE           10
  95. #define COND_MATH_GLUE      98
  96. #define MU_GLUE             99
  97. #define A_LEADERS           100
  98. #define C_LEADERS           101
  99. #define X_LEADERS           102
  100. #define glue_ptr            llink
  101. #define leader_ptr          rlink
  102.  
  103. #define GLUE_SPEC_SIZE      4
  104. #define glue_ref_count(G)   link(G)
  105. #define stretch(G)          mem[G + 2].sc
  106. #define shrink(G)           mem[G + 3].sc
  107. #define stretch_order       type
  108. #define shrink_order        subtype
  109. #define FIL                 1
  110. #define FILL                2
  111. #define FILLL               3
  112.  
  113. ptr     new_kern();
  114.  
  115. #define KERN_NODE           11
  116. #define EXPLICIT            1
  117. #define ACC_KERN            2
  118.  
  119. ptr     new_penalty();
  120.  
  121. #define PENALTY_NODE        12
  122. #define INF_PENALTY         10000L
  123. #define EJECT_PENALTY       -INF_PENALTY
  124. #define penalty(P)          mem[P + 1].i
  125.  
  126. #define UNSET_NODE          13
  127. #define span_count          subtype
  128. #define glue_stretch(U)     mem[U + GLUE_OFFSET].sc
  129. #define glue_shrink         shift_amount
  130.  
  131. int     print_short_display();
  132. int     print_font_and_char();
  133. int     print_mark();
  134. int     print_rule_dimen();
  135. int     print_glue();
  136. int     print_spec(); 
  137.  
  138. #define node_list_display(N) \
  139.     {append_char('.'); show_node_list(N); flush_char();}
  140.  
  141. global  fnt     font_in_short_display;
  142. global  val     depth_threshold;
  143. global  val     breadth_max;
  144.  
  145. int     show_node_list();
  146. int     show_box();
  147. int     show_info();
  148. int     short_display();
  149.  
  150. ptr     copy_node_list();
  151. int     flush_node_list();
  152.  
  153. int     delete_glue_ref();
  154. #define fast_delete_glue_ref(G) \
  155.     {if (glue_ref_count(G) == NULL) \
  156.         free_node(G, GLUE_SPEC_SIZE); \
  157.     else decr(glue_ref_count(G));}
  158. #define add_glue_ref(G) \
  159.     incr(glue_ref_count(G))
  160.